iterate though large amount of data in python